package com.spa.modules.gen.entity;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

import org.springframework.format.annotation.DateTimeFormat;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * 描述: gen_table author: P0081447 date: 2022-06-27 20:27:48
 */
@TableName("gen_table")
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value = "gen_table对象", description = "用户")
public class GenTable implements Serializable {

	private static final long serialVersionUID = 1L;

	// 唯一标识
	@ApiModelProperty(value = "唯一标识")
	@TableId(type = IdType.ASSIGN_UUID)
	private String id;

	/**
	 * 表信息
	 */
	// 数据源名称
	@ApiModelProperty(value = "数据源名称")
	@TableField(value = "db_name")
	private String dbName;
	// 数据源id
	@ApiModelProperty(value = "数据源id")
	@TableField(value = "db_id")
	private String dbId;
	// 名称
	@ApiModelProperty(value = "名称")
	@TableField(value = "name")
	private String name;
	// 描述
	@ApiModelProperty(value = "描述")
	@TableField(value = "comments")
	private String comments;
	// 实体类名称
	@ApiModelProperty(value = "实体类名称")
	@TableField(value = "class_name")
	private String className;

	/**
	 * 生成策略
	 */
	// 模版路径
	@ApiModelProperty(value = "模版路径")
	@TableField(value = "template_name")
	private String templateName;
	// 生成包路径
	@ApiModelProperty(value = "生成包路径")
	@TableField(value = "package_name")
	private String packageName;
	// 生成模块名
	@ApiModelProperty(value = "生成模块名")
	@TableField(value = "module_name")
	private String moduleName;
	// 生成子模块名
	@ApiModelProperty(value = "生成子模块名")
	@TableField(value = "subModule_name")
	private String subModuleName;
	// 生成功能名
	@ApiModelProperty(value = "生成功能名")
	@TableField(value = "function_name")
	private String functionName;
	// 生成功能名（简写）
	@ApiModelProperty(value = "生成功能名（简写）")
	@TableField(value = "function_name_simple")
	private String functionNameSimple;
	// 生成功能作者
	@ApiModelProperty(value = "生成功能作者")
	@TableField(value = "function_author")
	private String functionAuthor;
	// 输出路径
	@ApiModelProperty(value = "输出路径")
	@TableField(value = "output_dir")
	private String outputDir;

	/**
	 * 子数据
	 */
	// 表列
	@ApiModelProperty(value = "表列")
	@TableField(exist = false)
	private List<GenTableColumn> columnList;

	// 状态
	@ApiModelProperty(value = "状态")
	@TableField(value = "status")
	private String status;
	// 创建人
	@ApiModelProperty(value = "创建人")
	@TableField(value = "create_by", fill = FieldFill.INSERT)
	private String createBy;
	/** 创建时间 */
	@ApiModelProperty(value = "创建时间")
	@TableField(value = "create_time", fill = FieldFill.INSERT)
	@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	private Date createTime;
	// 更新人
	@ApiModelProperty(value = "更新人")
	@TableField(value = "update_by", fill = FieldFill.INSERT_UPDATE)
	private String updateBy;
	/** 更新时间 */
	@ApiModelProperty(value = "更新时间")
	@TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
	@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	private Date updateTime;
}
